import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/link_model_entity.dart';

LinkModelEntity $LinkModelEntityFromJson(Map<String, dynamic> json) {
  final LinkModelEntity linkModelEntity = LinkModelEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    linkModelEntity.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    linkModelEntity.name = name;
  }
  final String? link = jsonConvert.convert<String>(json['link']);
  if (link != null) {
    linkModelEntity.link = link;
  }
  return linkModelEntity;
}

Map<String, dynamic> $LinkModelEntityToJson(LinkModelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['link'] = entity.link;
  return data;
}

extension LinkModelEntityExt on LinkModelEntity {
  LinkModelEntity copyWith({
    int? id,
    String? name,
    String? link,
  }) {
    return LinkModelEntity()
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..link = link ?? this.link;
  }
}